﻿using BootstrapBlazor.Components;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace OnWork.DataCenter.Shared.Pages.DataCenter
{
    internal class DBConnPageVO
    {
        /// <summary>
        /// 雪花ID
        /// </summary>
        [AutoGenerateColumn(Visible = false, Readonly = true)]
        public long id { get; set; }

        /// <summary>
        /// 数据连接名称
        /// </summary>
        [Required(ErrorMessage = "{0}不能为空"), MaxLength(255)]
        [AutoGenerateColumn(Text = "连接名", Searchable = true, Filterable = true, Sortable = true), DisplayName("连接名")]
        public string name { get; set; } = "";

        /// <summary>
        /// 数据库类型
        /// </summary>
        [Required(ErrorMessage = "{0}不能为空")]
        [AutoGenerateColumn(Text = "数据库类型", Searchable = false, Filterable = false, Sortable = true), DisplayName("数据库类型")]
        public SqlSugar.DbType type { get; set; }

        /// <summary>
        /// 初始数据库
        /// </summary>
        [AutoGenerateColumn(Text = "初始数据库"), DisplayName("初始数据库")]
        public string? database { get; set; }

        /// <summary>
        /// 主机地址
        /// </summary>
        [AutoGenerateColumn(Text = "主机"), DisplayName("主机")]
        public string? host { get; set; }

        /// <summary>
        /// 端口号
        /// </summary>
        [AutoGenerateColumn(Text = "端口"), DisplayName("端口")]
        public int port { get; set; }

        /// <summary>
        /// 用户名
        /// </summary>
        [AutoGenerateColumn(Text = "用户名"), DisplayName("用户名")]
        public int user { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        [AutoGenerateColumn(Text = "密码"), DisplayName("密码")]
        public string? password { get; set; }
    }
}